mystr = "hello world and itcast and itheima and Python"

# 1. startswith(): 判断字符串是否以某个子串开头
print(mystr.startswith('hello'))
print(mystr.startswith('hel'))
print(mystr.startswith('hels'))


# 2. endswith(): 判断字符串是否以某个子串结尾
print(mystr.endswith('Python'))
print(mystr.endswith('Pythons'))


# 3. isalpha(): 字母（单个中文字结果也为true）
print(mystr.isalpha())

# 4. isdigit(): 数字
print(mystr.isdigit())
mystr1 = '12345'
print(mystr1.isdigit())

# 5. isalnum() : 数字或字母或组合
print(mystr1.isalnum())
print(mystr.isalnum())
mystr2 = 'abc123'
print(mystr2.isalnum())


# 6.isspace(): 空白
print(mystr.isspace())
mystr3 = '   '
print(mystr3.isspace())

